/*
 * dumy.c
 *
 *  Created on: 2010-11-21
 *      Author: terry
 */

#include "dumy.h"
#include "allegrosbAppUi.h"
#include <coemain.h>
#include "timeouttimer.h"

uid_t geteuid()
	{
	return 0;
	}

gid_t getegid()
	{
	return 0;
	}


void draw_to_native(unsigned char* data, int w, int h)
	{
	CallegrosbAppUi* appui = (CallegrosbAppUi*)CCoeEnv::Static()->AppUi();
	appui->draw_to_native(data, w, h);
	}

void* timer_init(TTimerCallBack_Func callback, int interval)
	{
		CTimeOutTimer* result = 0;
		result = CTimeOutTimer::NewL(CTimer::EPriorityIdle, callback);
		if(result)
			{
			result->After(interval);
			}
		return result;
	}

void timer_exit(void* ptimer)
	{
		if(ptimer)
			{
			CTimeOutTimer* result = (CTimeOutTimer*)ptimer;
			delete result;
			}
	}

void timer_after(void* ptimer, int interval)
	{
	if(ptimer)
			{
			CTimeOutTimer* result = (CTimeOutTimer*)ptimer;
			result->After(interval);
			}
	}
